package com.android.adviserapplication.sqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

public class DBHelper extends SQLiteOpenHelper {

	private static final String dbName = "QuizData";
	private static final int dbVersion = 1;
	//private String createTableSQL, dropTableSQL;
	private static final String CREATE_TABLE_SQL = "create table quiz_table"
			+ "(qid integer primary key autoincrement, "
			+ "english_word text not null, " + "japanese_word text not null, "
			+ "qlevel integer not null)";

	private static final String DROP_TABLE_SQL = "drop table if exists quiz_table";
	
	public DBHelper(Context context){
		super(context, dbName, null, dbVersion);
		// TODO �����������ꂽ�R���X�g���N�^�[�E�X�^�u
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO �����������ꂽ���\�b�h�E�X�^�u
		db.execSQL(CREATE_TABLE_SQL);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO �����������ꂽ���\�b�h�E�X�^�u
		db.execSQL(DROP_TABLE_SQL);
		onCreate(db);
	}
}